﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace RiskMan.DataClass.AlfaDirectFolder
{
    /// <summary>
    /// ТАБЛИЦА «TRADE_TYPES» - СПРАВОЧНИК ТИПОВ СДЕЛОК
    /// Ключевое поле: trd_type_code
    /// </summary>
    class TradeTypes : INotifyPropertyChanged
    {
        #region Private

        private string _trdTypeCode;
        private string _trdTypeDesctiption;
        private int _iLastUpdate;
        private int _trdTypeNumCode;

        #endregion

        #region Public

        /// <summary>
        /// Код типа сделки.
        /// </summary>
        public string TrdTypeCode
        {
            get { return _trdTypeCode; }
            set
            {
                if (_trdTypeCode != value)
                    _trdTypeCode = value;

                RaisePropertyChanged("TrdTypeCode");
            }
        }
        /// <summary>
        /// Описание типа сделки.
        /// </summary>
        public string TrdTypeDesctiption
        {
            get { return _trdTypeDesctiption; }
            set
            {
                if (_trdTypeDesctiption != value)
                    _trdTypeDesctiption = value;

                RaisePropertyChanged("TrdTypeDesctiption");
            }
        }
        /// <summary>
        /// Временная метка последнего обновления.
        /// </summary>
        public int ILastUpdate
        {
            get { return _iLastUpdate; }
            set
            {
                if (_iLastUpdate != value)
                    _iLastUpdate = value;

                RaisePropertyChanged("ILastUpdate");
            }
        }
        /// <summary>
        /// Числовой код типа сделки.
        /// </summary>
        public int TrdTypeNumCode
        {
            get { return _trdTypeNumCode; }
            set
            {
                if (_trdTypeNumCode != value)
                    _trdTypeNumCode = value;

                RaisePropertyChanged("TrdTypeNumCode");
            }
        }

        #endregion

        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
